function diff = root_w( x, ind, param, param_ini, aux)

    param.omega_0 = x;
    
    x0= fzero(@ (x) model_shock(x,param_ini.mean_x.*(1-param.shock).^(1./(1-param.alpha)),param,aux), log(param_ini.lambda), optimset('display','iter'));
    param.lambda = exp(x0);
    param = model( param, aux);

    if ind==1
        diff = log(u_fun(param)/u_fun(param_ini).*param.lambda./param_ini.lambda.*(1-u_fun(param_ini))./(1-u_fun(param)))/log(mean_fun(aux.n,'m',param)./mean_fun(aux.n,'m',param_ini)) - param.EU_cycl_mom;
    else
        diff = param;
    end
    
end